import time

from selenium import webdriver
from selenium.webdriver.common.by import By

# TODO 导入AC类
from selenium.webdriver.common.action_chains import ActionChains
driver = webdriver.Chrome()
driver.get('https://sahitest.com/demo/clicks.htm')

# TODO 创建AC对象             参数：driver对象
ac = ActionChains(driver)



# TODO 调用鼠标方法并执行        参数：要执行的对象
time.sleep(2)
btn = driver.find_element(By.XPATH,'/html/body/form/input[3]')
ac.click(btn).perform()


# 关闭浏览器
time.sleep(2)
driver.quit()